package com.explorati.design_pattern.creational.builder.example.v2;

public class Product {

	private String productName;
	private String produceDate;
	private String productInstruction;

	public Product(Builder builder) {
		this.productName = builder.productName;
		this.produceDate = builder.produceDate;
		this.productInstruction = builder.productInstruction;
	}
	
	

	@Override
	public String toString() {
		return "Product [productName=" + productName + ", produceDate=" + produceDate + ", productInstruction="
				+ productInstruction + "]";
	}



	public static class Builder {
		private String productName;
		private String produceDate;
		private String productInstruction;
		
		public Builder(){}

		public Builder buildProductName(String productName) {
			this.productName = productName;
			return this;
		}

		public Builder buildProduceDate(String produceDate) {
			this.produceDate = produceDate;
			return this;
		}

		public Builder buildProductInstruction(String productInstruction) {
			this.productInstruction = productInstruction;
			return this;
		}

		//进行建造
		public Product build(){
			return new Product(this);
		}
	}
}
